﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;

namespace LogisticsWebApp.anonymity
{
    public partial class PersonalRegister : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void registerButton_Click(object sender, EventArgs e)
        {
            PersonalUser user = new PersonalUser
            {
                Id = this.id.Text,
                Password = this.password.Text,
                RealName = this.realName.Text,
                TitleOfCourtesy = this.titleOfCourtesy.SelectedValue,
                Position = this.position.Text,
                Email = this.email.Text,
                FixPhone = this.fixedPhone.Text,
                Fax = this.fax.Text,
                CellPhone = this.cellPhone.Text,
                CompanyName = this.company.Text,
                ReceiveMsg = this.ReceiveMsg.Checked
            };

            PersonalUserDataAccess userDA = new PersonalUserDataAccess();
            userDA.CreateUser(user);

            Server.Transfer(string.Format("registerresult.aspx?userid={0}",this.id.Text));
        }
    }
}
